import React, {Component} from 'react';
import './index.less'
import { Card } from 'antd';
import {withRouter} from "react-router-dom";
const { Meta } = Card;
class AllSideGoodsItem extends Component {
    goDetail = (gid) => {
        return () => {
            this.props.history.push(`/detail?gid=${gid}`)
        }
    }
    render() {
        const {gid,gxsimg,gprice,gdesc,gtitle} = this.props.data
        return (
            <div className='AllSideGoodsItem'>
                <Card

                    onClick={this.goDetail(gid)}
                    className='AllSideGoodsItemCard'
                    style={{ width: '100%' }}
                    cover={
                        <img
                            alt="goods"
                            src={gxsimg}
                            className='ShowImg'
                        />
                    }
                >
                    <Meta
                        title={(<div className='ShowTitle'>{gtitle}</div>)}
                        description={
                            (
                                <div>
                                    <div className='ShowDesc'>{gdesc}</div>
                                    <div className='ShowPrice'>￥{gprice}</div>
                                </div>
                            )
                        }
                    />
                </Card>
            </div>
        );
    }
}

export default withRouter(AllSideGoodsItem);